<template>
  <div class="app-container">
    <el-table
      :data="tableData"
      stripe
      style="width: 100%">
      <el-table-column
        prop="createTime"
        label="时间"
        width="240">
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        width="100">
      </el-table-column>
      <el-table-column
        prop="uid"
        label="账号"
        width="180">
      </el-table-column>
      <el-table-column
        prop="action"
        label="操作"
        width="200">
      </el-table-column>
      <el-table-column
        prop="result"
        label="结果"
        width="80">
      </el-table-column>
      <el-table-column
        prop="detail"
        label="详细信息">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { getLog } from '@/api/log'
export default {
  name: 'Log',
  data() {
    return {
      tableData: [],
      query: {
        aid: null,
        page: 1,
        limit: 10,
      },
    }
  },
  computed: {
    ...mapGetters([
      'uid',
    ]),
  },
  created(){
    this.query.aid = this.uid
    this.getLogList()
  },
  methods: {
    getLogList(){
      getLog(this.query).then(response => {
        this.tableData = response.load.logList
      }).catch(()=>{
        console.log("获取日志列表失败")
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.app-container {
  padding: 32px;
  // background-color: rgb(240, 242, 245);
}
</style>
